<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ page import="java.text.SimpleDateFormat" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<meta http-equiv="X-UA-Compatible" content="IE=7" />
		<title>专业虚拟币交易平台--孔方交易平台</title>
		<meta name="keywords" content="比特币、莱特币、狗币等众多虚拟币交易平台">
		<meta name="description" content="孔方交易平台是专业虚拟币交易平台，支持多种虚拟币交易">
		<link href="http://rs.btc38.com/statics/css/common.css" rel="stylesheet" type="text/css" />
		<script type="text/javascript" src="http://rs.btc38.com/statics/js/jquery.min.js"></script>
		<script type="text/javascript" src="http://rs.btc38.com/statics/js/jquery.cookie.js"></script>
		<script type="text/javascript" src="http://rs.btc38.com/statics/js/jquery.sgallery.js"></script>
		<meta property="qc:admins" content="4211660677624330637574214560454" />
		<style type="text/css">
			#header{margin-top: 20px; height: 200px;}
			#header_logo{float: left; width: 260px;height: 200px;}
			#header_title {float: left; width: 700px; overflow: hidden;}
			#header_title ul{margin-top: 180px;}
			#header_title li{display: inline; margin: 0 20px; font-size: 20px; font-weight: 500;}
			#header_login {float: left; margin: 170px 0 0 20px; font-size: 14px; background-color: #4dafcd; padding: 10px 20px; width: 100px; height: 20px; overflow: hidden; text-align: center; vertical-align: middle; color:white; position: relative; overflow: visible;}
			#login_pop{width: 310px; background-color: #4dafcd; font-size: 14px; position: absolute; top: 40px; right: 0px; color: white; text-align: left; }
			#login_pop a{color: white;}
		</style>
	</head>
	<body>
		<div class="bk20"></div>
		<div id="header" style="width: 1200px; margin: 0 auto">
			<div id="header_logo" >
				<a href="/portal/index.jsp" title="孔方网官网首页"><img src="img/logo.gif" alt="孔方网官方LOGO" width="200" height="200"/>
				</a>
			</div>
			<div id="header_title">
				<ul>
					<li><a href="/">孔方网首页</a></li>
					<li><a href="/trade.html">虚拟币市场</a></li>
					<li><a href="/pool.html">虚拟币矿池</a></li>
					<li><a href="http://www.coin38.org/" target="_blank">孔方园</a></li>
				</ul>
			</div>
			<div id="header_login">
				<span id="header_login_text"></span>
				<div id="login_pop" style="display:none;">
					<ul style="margin:160px 10px 0;">
						<li style="height: 45px;">
							<div id="login_pic" style="float:left;"></div>
							<div style="float:left; margin-left: 10px;">
								<span id="login_name" style="margin-right:5px;"></span><a href="javascript:logout()">退出登录</a>
								<br />
								我的ID<span id="login_id" style="margin-left:5px;"></span>
							</div>
						</li>
						<li style="border-bottom:1px dashed #ccc; line-height:0; margin: 5px 0; font-size:0;"></li>
						<li style="height: 25px; font-size: 12px; line-height: 180%;">
							<span style=""><img src="/statics/images/v9/m_tel_icon.png" style="vertical-align:text-bottom;" /> <a id="login_tel_status" href="/trade/binding_tel.html" ></a> <img src="/statics/images/v9/m_card_icon.png" style="vertical-align:text-bottom; margin-left: 10px;"  /> <a id="login_cred_status" href="/trade/rnsys.html"></a> <img src="/statics/images/v9/m_lock_icon.png" style="vertical-align:text-bottom; margin-left: 10px;" /> <a href="/trade/trade_pwd.html">交易密码</a></span>
						</li>
						<li style="border-bottom:1px dashed #ccc; line-height:0; margin: 5px 0; font-size:0;"></li>
						<li style="line-height: 180%;"><a href="/trade/trade_balance.html">资金管理/充值/提款</a> | <a href="/trade/trade_order.html">我的委单</a> | <a href="/trade/trade_clinch.html">成交记录</a><br /><a href="/trade/tmc_bonus.html">我的时代币和分红</a>(<a href="/trade/trade_bonus.html">规则</a>) | <a href="/trade/cs_qaa.html">客服有问必答</a></li>
						<li style="border-bottom:1px dashed #ccc; line-height:0; margin: 5px 0; font-size:0;"></li>
					</ul>
					<div id="gonggao" style="font-size: 12px; line-height: 180%; margin: 0 10px 10px;"></div>
				</div>
			</div>
		</div>
		<div style="height: 2px;background-color: #4dafcd; width: 100%; margin-top: 15px; min-width: 1200px;"></div><br />
		<script type="text/javascript" language="javascript">
    var coinName = window.location.search;
    var coinNameCN = "unknown";
    if (coinName.length == 0 || coinName.indexOf("btc38_trade_coin_name") < 0)
        coinName = "BTC";
    else
        coinName = coinName.substring(coinName.lastIndexOf("=") + 1, coinName.length).toLocaleUpperCase();

    if (coinName == "BTC")
        coinNameCN = "比特币";
    else if (coinName == "LTC")
        coinNameCN = "莱特币";
    else if (coinName == "XPM")
        coinNameCN = "质数币";
    else if (coinName == "XRP")
        coinNameCN = "瑞波币";
    else if (coinName == "ZCC")
        coinNameCN = "招财币";
    else if (coinName == "MEC")
        coinNameCN = "美卡币";
    else if (coinName == "ANC")
        coinNameCN = "阿侬币";
    else if (coinName == "BEC")
        coinNameCN = "比奥币";
    else if (coinName == "PPC")
        coinNameCN = "点点币";
    else if (coinName == "SRC")
        coinNameCN = "安全币";
    else if (coinName == "TAG")
        coinNameCN = "悬赏币";
    else if (coinName == "PTS")
        coinNameCN = "比特股";
    else if (coinName == "TMC")
        coinNameCN = "时代币";
    else if (coinName == "WDC")
        coinNameCN = "世界币";
    else if (coinName == "APC")
        coinNameCN = "苹果币";
    else if (coinName == "DGC")
        coinNameCN = "数码币";
    else if (coinName == "UNC")
        coinNameCN = "联合币";
    else if (coinName == "QRK")
        coinNameCN = "夸克币";
    else if (coinName == "DOG")
        coinNameCN = "狗狗币";
    else if (coinName == "YBC")
        coinNameCN = "元宝币";
    else if (coinName == "RIC")
        coinNameCN = "黎曼币";
    else if (coinName == "BIL")
        coinNameCN = "比利币";
    document.title = coinNameCN + "(" + coinName + ")交易市场 - 专业比特币、莱特币、山寨币交易平台 - 比特时代";
</script>
<div style="width:1200px; margin:0 auto;">
    <div style="width:888px;float:left;padding:0 24px 0 0;">
        <div class="coinMenu_left"></div>
        <div class="coinMenu_curr"><b><span id="coinName1"></span>/CNY</b></div>
        <div class="coinMenu_btn" onmouseover="this.style.backgroundColor = '#E8EEF0'" onmouseout="this.style.backgroundColor = '#F9F9F9'"><a href="#" id="link_info"><span id="coinName2"></span>资料</a></div>
        <div class="coinMenu_btn" onmouseover="this.style.backgroundColor = '#E8EEF0'" onmouseout="this.style.backgroundColor = '#F9F9F9'"><a href="#" id="link_news"><span id="coinName3"></span>新闻</a></div>
        <div class="coinMenu_btn" onmouseover="this.style.backgroundColor = '#E8EEF0'" onmouseout="this.style.backgroundColor = '#F9F9F9'"><a href="JavaScript:alert('虚拟币应用专区还在睡觉，预计3月26日起床，不要吵醒它噢^_^ 欢迎商家及其它应用联系我们，我们会免费收录您的产品在我们的应用专区，为您带来流量');" id="link_apps"><span id="coinName4"></span>应用</a></div>
        <div class="coinMenu_right"></div>
        <div id="trade_main">
            <div style="position: relative;top:28px;left:500px;z-index:99;width:150px"><a href="http://btc38.guiying.org/" style="color:#3377AA" target="_blank" id="guiyingBTN">高级</a> <a href="JavaScript:get5minLine();" style="color:#3377AA" id="fiveLineBTN">5分钟线</a> <a href="JavaScript:getTimeLine();" style="color:#3377AA" id="timeLineBTN">小时线</a> <a href="JavaScript:getDayLine();" style="color:#3377AA" id="dayLineBTN">日线</a></div>
            <div width="width:880px">
                <div id="graphbox" style="width:658px;height:330px;float:left;border:1px #F0F0F0 solid;margin-right:15px"></div>
                <div style="width:210px;height:330px;float:left">
                    <div style="font-size:18px;color:#FF9933;font-weight:600" nowrap>￥<span style="font-size:32px;line-height:130%" id="newestPrice">0.00</span></div>
                    <div class="bk10 hr"></div>
                    <div style="float:left;width:105px">
                        <div style="font-size:15px;color:#0AB92B;font-weight:600" id="buy1Price">0.00</div>
                        <div style="font-size:12px;color:#999999">买1价(CNY)</div>
                    </div>
                    <div style="float:left;width:105px">

                        <div style="font-size:15px;color:#F01717;font-weight:600" id="sell1Price">0.00</div>
                        <div style="font-size:12px;color:#999999">卖1价(CNY)</div>
                    </div>
                    <div class="bk10 hr"></div>
                    <div style="float:left;width:105px">
                        <div style="font-size:15px;color:#555555" id="volumeOf24Hours">0.00</div>
                        <div style="font-size:12px;color:#999999">24H成交量(<span id="coinName5"></span>)</div>
                    </div>
                    <div style="float:left;width:105px">
                        <div style="font-size:15px;color:#555555" id="balanceOf24Hours">0.00</div>
                        <div style="font-size:12px;color:#999999">24H成交额(CNY)</div>
                    </div>
                    <div class="bk10 hr"></div>
                    <div style="float:left;width:105px">
                        <div style="font-size:15px;color:#555555" id="rangeOf24Hours">0.00%</div>
                        <div style="font-size:12px;color:#999999">24H涨跌幅</div>
                    </div>
                    <div class="bk30"></div>
                    <div class="bk30"></div>
                    <div class="bk30"></div>
                    <div class="bk20"></div>
                    <div>
                        <div class="btn_buy"><a href="JavaScript:displayBuyBanner();">买入<span id="coinName6"></span></a></div>
                        <div class="btn_sell"><a href="JavaScript:displaySellBanner();">卖出<span id="coinName7"></span></a></div>
                    </div>
                </div>
            </div>
            <div id="buyBox" style="clear:both;display:none;width:868px;height:108px;background:url(http://rs.btc38.com/statics/images/v9/m_banner_buy.png) no-repeat;margin-top:5px;" class="inputNum">
                <table style="font-size:13px;" class="tableStyle2">
                    <tr height=25><td></td></tr>
                    <tr height=35>
                        <th width=108 align=right>我的CNY余额&nbsp;</th>
                        <td width=108><input type=text readonly="readonly" id="cny_balance1"></td>
                        <th width=108 align=right>买入价格(CNY)&nbsp;</th>
                        <td width=108><input type=text style="background:#FFFFFF;border:1px solid #05A500;color:#0AA91B;font-weight:600" id="price1" onkeyup="JavaScript:resetInputsNumByPrice1();"></td>
                        <th width=108 align=right>买入数量(<span id="coinName8"></span>)&nbsp;</th>
                        <td width=108 style='text-align:left'><input type=text style="background:#FFFFFF;border:1px solid #05A500;color:#0AA91B;font-weight:600" id="amount1" onkeyup="JavaScript:resetInputsNumByAmount1();"></td>
                        <th width=108 align=right>成交额(CNY)&nbsp;</th>
                        <td width=108><input type=text readonly="readonly" id="totalBalance1"></td>
                    </tr>
                    <tr height=35>
                        <th align=right>我的<span id="coinName9"></span>数量&nbsp;</th>
                        <td><input type=text readonly="readonly" id="coin_balance1"></td>
                        <th align=right>最多可买(<span id="coinName10"></span>)&nbsp;</th>
                        <td><input type=text readonly="readonly" id="maxNum1"></td>
                        <th align=right>实际到账(<span id="coinName11"></span>)&nbsp;</th>
                        <td colspan=2 style='text-align:left'><table><tr><td><input type=text readonly="readonly" id="actuallyGet1"></td><td style="font-size:12px">&nbsp;(手续费<span id="fee"></span>)</td></tr></table></td>
                        <td id="submitOrderBTN1"><a href="JavaScript:submitOrder('1');"><img src="http://rs.btc38.com/statics/images/v9/m_confirm_buy.png"></a></td>
                    </tr>
                </table>
            </div>
            <div id="sellBox" style="clear:both;display:none;width:868px;height:108px;background:url(http://rs.btc38.com/statics/images/v9/m_banner_sell.png) no-repeat;margin-top:5px" class="inputNum">
                <table style="font-size:13px;" class="tableStyle2">
                    <tr height=25><td></td></tr>
                    <tr height=35>
                        <th width=108 align=right>我的CNY余额&nbsp;</th>
                        <td width=108><input type=text readonly="readonly" id="cny_balance2"></td>
                        <th width=108 align=right>卖出价格(CNY)&nbsp;</th>
                        <td width=108><input type=text style="background:#FFFFFF;border:1px solid #D65E4B;color:#DD2222;font-weight:600" id="price2" onkeyup="JavaScript:resetInputsNumByPrice2();"></td>
                        <th width=108 align=right>卖出数量(<span id="coinName12"></span>)&nbsp;</th>
                        <td width=108 style='text-align:left'><input type=text style="background:#FFFFFF;border:1px solid #D65E4B;color:#DD2222;font-weight:600" id="amount2" onkeyup="JavaScript:resetInputsNumByAmount2();"></td>
                        <th width=108 align=right>成交额(CNY)&nbsp;</th>
                        <td width=108><input type=text readonly="readonly" id="totalBalance2"></td>
                    </tr>
                    <tr height=35>
                        <th align=right>我的<span id="coinName13"></span>数量&nbsp;</th>
                        <td><input type=text readonly="readonly" id="coin_balance2"></td>
                        <th align=right>全卖可得(CNY)&nbsp;</th>
                        <td><input type=text readonly="readonly" id="maxNum2"></td>
                        <th align=right>实际到账(CNY)&nbsp;</th>
                        <td colspan=2 style='text-align:left'><table><tr><td><input type=text readonly="readonly" id="actuallyGet2"></td><td style="font-size:12px">&nbsp;(手续费<span id="fee1"></span>)</td></tr></table></td>
                        <td id="submitOrderBTN2"><a href="JavaScript:submitOrder('2');"><img src="http://rs.btc38.com/statics/images/v9/m_confirm_sell.png"></a></td>
                    </tr>
                </table>
            </div>
            <div id="pwdDiv" style="display:none;clear:both;width:844px;border:2px solid #DD8800;padding:10px;margin-top:10px;background:#FFE7C1;font-size:14px">
                <table><tr><td style="padding:5px">登录后的首笔挂单，为了您的账户安全，请输入交易密码</td><td style="padding:5px"><input type=password id="order_pwd" style="background:#FFFFFF;border:1px solid #FF9900;font-size:14px;height:25px;line-height:25px" maxlength=16 size=12></td><td id="pwd_submit_td" style="padding:5px"><a href="JavaScript:submitOrderAndPWD();"><img src="http://rs.btc38.com/statics/images/v9/m_btn_pwdsubmit.png"></a></td><td style="padding:5px;color:#888888">登录后第二次挂单不再需要输入交易密码</td></tr></table>
            </div>
            <div style="clear:both;display:none;" id="newCoinNotice">
                <div class="bk10"></div>
                <div style="clear:both;padding:10px;width:846px;font-size:15px;color:#990000;background:#FFCCCC;border:solid 1px #990000;" id="newCoinNoticeText"></div>
            </div>
            <div id="myOrderDiv" style="display:none">
                <div class="bk20"></div>
                <div style="margin: 5px 0;font-size:16px;color:#4DAFCD"><b>我的<span id="coinName14"></span>委单</b></div>
                <div style="clear:both;height:1px;background:#4DAFCD;width:881px;margin: 5px 0 0 0"></div>
                <table width="881" id="myOrderTable" class="tableStyle1">
                    <tr height=35>
                        <th width=175>挂单时间</th>
                        <th width=108>挂单类型</th>
                        <th width=160>挂单价格(CNY)</th>
                        <th width=160>挂单数量(<span id="coinName15"></span>)</th>
                        <th width=160>挂单总额(CNY)</th>
                        <th width=118>操作</th>
                    </tr>
                    <tr height="35">
                        <td colspan=6>正在加载我的委单信息</td>
                    </tr>
                </table>

            </div>
            <div class="bk20"></div>
            <div>
                <div style="margin-right:25px;float:left;width:428px">
                    <div style="margin: 5px 0;">
                        <table width="428" height="25"><tr><td valign="middle" width="318" style="font-size:16px;color:#009900;border:0px;float:left;line-height:25px;text-align:left;"><b>买入盘面</b></td><td width="110" align="right" valign="middle" style="border:0px;text-align:right"><select id="buyOrderNum" style="color:#666666"><option value="10" selected="true">显示10条</option><option value="20">显示20条</option><option value="30">显示30条</option></select></td></tr></table>
                    </div>
                    <div style="clear:both;height:1px;background:#009900;width:428px;margin: 5px 0 0 0"></div>
                    <table width="428" id="buyOrderTable" class="tableStyle1">
                        <tr>
                            <th width="68" height="35">档位</th>
                            <th width="120">买入价(CNY)</th>
                            <th width="120">买入量(<span id="coinName16"></span>)</th>
                            <th width="120">总额(CNY)</th>
                        </tr>
                        <tr>
                            <td colspan=4 height="35">正在加载委托买入的盘面数据</td>
                        </tr>
                    </table>
                </div>
                <div style="float:left;width:428px">
                    <div style="margin: 5px 0;">
                        <table width="428" height="25"><tr><td valign="middle" width="318" style="font-size:16px;color:#D01515;border:0px;float:left;line-height:25px;text-align:left;"><b>卖出盘面</b></td><td width="110" align="right" valign="middle" style="border:0px;text-align:right"><select id="sellOrderNum" style="color:#666666"><option value="10" selected="true">显示10条</option><option value="20">显示20条</option><option value="30">显示30条</option></select></td></tr></table>
                    </div>
                    <div style="clear:both;height:1px;background:#D01515;width:428px;margin: 5px 0 0 0"></div>
                    <table width="428" id="sellOrderTable" class="tableStyle1">
                        <th width="68" height="35">档位</th>
                        <th width="120">卖出价(CNY)</th>
                        <th width="120">卖出量(<span id="coinName17"></span>)</th>
                        <th width="120">总额(CNY)</th>
                        </tr>
                        <tr>
                            <td colspan=4 height="35">正在加载委托卖出的盘面数据</td>
                        </tr>
                    </table>
                </div>
            </div>
            <div class="bk20"></div>
            <div>
                <div style="margin: 5px 0;font-size:16px;color:#FF9933;"><b>最新成交记录</b></div>
                <div style="clear:both;height:1px;background:#FF9933;width:881px;margin: 5px 0 0 0"></div>
                <table style="float:left" width="881" id="tradeTable" class="tableStyle1">
                    <tr>
                        <th width="211" height="35">成交时间</th>
                        <th width="130">类型</th>
                        <th width="180">成交价(CNY)</th>
                        <th width="180">成交量(<span id="coinName18"></span>)</th>
                        <th width="180">成交额(CNY)</th>
                    </tr>
                    <tr>
                        <td colspan=5 height="35">正在加载最新的成交记录数据</td>
                    </tr>
                </table>
            </div>
        </div>
    </div>
    <script src="http://rs.btc38.com/statics/js/tradetimeline.js?t=201307031703"></script>
    <script src="http://rs.btc38.com/statics/js/highstock.js?v=4"></script>
    <div style="width:288px;float:left">
        <div style="font-size:16px;">
    <a href="/trade.html?btc38_trade_coin_name=btc" title="百分比表示过去24小时该币的涨跌幅">
        <div class="coinlist" onmouseover="this.style.background = '#E9EFF8';" onmouseout="this.style.background = '#F9F9F9';">
            <div class="coinlist_logo"><img src="http://rs.btc38.com/statics/images/coin_logos/BTC_logo.png" width="19" height="19"></div><div class="coinlist_name">比特币BTC</div><div class="coinlist_price" id="btc2cny">Loading</div><div class="coinlist_range" id="btc2cnyrange">Loading</div>
            <div style="clear:both"></div>
        </div>
    </a>
    <div class="hr bk10"></div>
    <a href="/trade.html?btc38_trade_coin_name=ltc" title="百分比表示过去24小时该币的涨跌幅">
        
<script type="text/javascript" language="javascript">
            var ajaxObjForMenu = null;

            getMenuPrice();
            window.setInterval(getMenuPrice, 120000);
            function getMenuPrice()
            {
                if (window.XMLHttpRequest)
                    ajaxObjForMenu = new XMLHttpRequest();
                else if (window.ActiveXObject)
                    ajaxObjForMenu = new ActiveXObject("Microsoft.XMLHTTP");
                if (ajaxObjForMenu != null)
                {
                    var url = "/httpAPI.php?n=" + Math.random();
                    ajaxObjForMenu.onreadystatechange = updateMenuPrice;
                    ajaxObjForMenu.open("GET", url, true);
                    ajaxObjForMenu.send(null);
                }
            }

            function updateMenuPrice()
            {
                if (ajaxObjForMenu.readyState == 4)
                {
                    if (ajaxObjForMenu.status == 200)
                    {
                        var coinnameArr = new Array();
                        coinnameArr = ["btc", "ltc", "dog", "mec", "xrp", "wdc", "pts", "xpm", "apc", "qrk", "ybc", "zcc", "bec", "ppc", "bil", "src", "tag", "unc", "anc", "ric", "dgc", "tmc"];
                        var range = 0;
                        var jsonObj = eval("(" + ajaxObjForMenu.responseText + ")");

                        for (index in coinnameArr)
                        {
                            eval("var price = jsonObj." + coinnameArr[index] + "2cny");
                            eval("var price_24h = jsonObj." + coinnameArr[index] + "2cny_24h");
                            if (coinnameArr[index] == "dog" || coinnameArr[index] == "bil")
                                document.getElementById(coinnameArr[index] + "2cny").innerHTML = parseFloat(price).toFixed(5).toString();
                            else
                                document.getElementById(coinnameArr[index] + "2cny").innerHTML = parseFloat(price).toFixed(3).toString();
                            range = (parseFloat(price) / parseFloat(price_24h)) - 1.0;
                            document.getElementById(coinnameArr[index] + "2cnyrange").innerHTML = (range >= 0) ? "+" + (range * 100).toFixed(1).toString() + "%" : (range * 100).toFixed(1).toString() + "%";
                            document.getElementById(coinnameArr[index] + "2cny").style.color = (range >= 0) ? "#0AB92B" : "#F23333";
                            document.getElementById(coinnameArr[index] + "2cnyrange").style.color = (range >= 0) ? "#0AB92B" : "#F23333";

                            if (document.getElementById("rangeOf24Hours") && coinnameArr[index] == coinName.toLocaleLowerCase())
                            {
                                document.getElementById("rangeOf24Hours").innerHTML = (range >= 0) ? "+" + (range * 100).toFixed(1).toString() + "%" : (range * 100).toFixed(1).toString() + "%";
                                document.getElementById("rangeOf24Hours").style.color = (range >= 0) ? "#0AB92B" : "#F23333";
                            }
                        }
                    }
                }
            }
</script><div class="hr bk20"></div>
<div>
    <div style="margin:10px 0;">
        <img src="http://rs.btc38.com/statics/images/v9/why_safe.png" style="float:left;margin:3px 10px 0 0">
        <b style="font-size:14px;color:#990000">更安全的</b><br />
        锁定提款地址，手机校验，人工审核<br />
    </div>
    <div style="margin:10px 0;">
        <img src="http://rs.btc38.com/statics/images/v9/why_regular.png" style="float:left;margin:3px 10px 0 0">
        <b style="font-size:14px;color:#990000">更正规的</b><br />
        正规工商注册企业，注册资金1000万<br />
    </div>
    <div style="margin:10px 0;">
        <img src="http://rs.btc38.com/statics/images/v9/why_cheap.png" style="float:left;margin:3px 10px 0 0">
        <b style="font-size:14px;color:#990000">更实惠的</b><br />
        低至0.1%交易手续费，行业最低<br />
    </div>
    <div style="margin:10px 0;">
        <img src="http://rs.btc38.com/statics/images/v9/why_hot.png" style="float:left;margin:3px 10px 0 0">
        <b style="font-size:14px;color:#990000">更热门的</b><br />
        20万用户首选，值得信任<br />
    </div>
    <div style="margin:10px 0;">
        <img src="http://rs.btc38.com/statics/images/v9/why_fast.png" style="float:left;margin:3px 10px 0 0">
        <b style="font-size:14px;color:#990000">更快捷的</b><br />
        QQ号直接登录，冲提最快10分钟到账<br />
    </div>
</div>
<div class="hr bk20"></div>
<div style="color:#990000;font-size:13px">
    <b>风险警示：</b>虚拟货币风险较高，请投资者在经济能力范围内参与，同时保持高度谨慎。
</div>
<div class="hr bk20"></div>
<div style="font-size:14px">
    <img src="http://rs.btc38.com/statics/images/v9/cs_icon.png" style="float:left;margin-right:15px;margin-bottom:180px">
    <b>比特时代客服中心</b><br />
    <a href="/trade/cs_qaa.html"><font color=red>点此向客服提问(推荐)</font></a><br />
    12群：333064652<br />
    11群：299102743<br />
    15群：168546317<br />
    14群：311607433<br />
    <a href="/general/670.html" target="_blank">更多QQ群>></a><br />
    TEL：0755-66800383<br />
    (电话服务时间9-23点)
</div>    </div>
</div>
<div style="width:1200px; margin:0 auto;font-size:12px;line-height:23px;text-align:center;">
    <div class="bk30 hr"></div>
    粤网文[2012]0884-143号 | <a href="http://www.miitbeian.gov.cn" target="_blank" ref="nofollow">粤ICP备12061242号</a> | 工商注册号440301106023830 | [ICP证]粤B2-20120185 | <a href="http://www.stclf.com/" target="_blank" ref="nofollow">法律顾问: 广东深天成律师事务所 周菲 戴斐 律师</a>
    <br />
    CopyRight &copy; 2013 比特时代 All Rights Reserved. Powered by 深圳智维网络有限公司
    <br />
    <a href="/sitemap.html" target="_blank">网站地图</a> | <a href="/general/789.html" target="_blank">交易行情API</a> | <a href="/general/571.html" target="_blank">约稿投稿</a> | +86-0755-66800383
    <br />&nbsp;
    <script type="text/javascript">
		var _hmt = _hmt || [];
		(function() {
			var hm = document.createElement("script");
			hm.src = "//hm.baidu.com/hm.js?a415e666baee8f21a707412783e345bc";
			var s = document.getElementsByTagName("script")[0];
			s.parentNode.insertBefore(hm, s);
		})();
    </script>
</div>
</body>
<script type="text/javascript" src="http://rs.btc38.com/statics/js/common2.js?20140416" ></script>
 <script type="text/javascript">
	displayLoginInfo();
	if(isLogin){
		boxFloat("header_login_text", "login_pop");
	}
</script>
</html><script type="text/javascript" language="javascript">
    var t_fee = 0.999;
    document.getElementById("fee").innerHTML = "0.1%";
    document.getElementById("fee1").innerHTML = "0.1%";
    if (coinName == "TMC")
    {
        document.getElementById("fee").innerHTML = "0.5%";
        document.getElementById("fee1").innerHTML = "0.5%";
        t_fee = 0.995;
    }

    var coinName_cp = coinName;
    if (coinName == "DOG")
        coinName_cp = "doge";
    for (var i = 1; i <= 18; i++)
    {
        document.getElementById("coinName" + i.toString()).innerHTML = coinName_cp;
    }
    document.getElementById("guiyingBTN").href = "http://btc38.guiying.org/charts/" + coinName.toLocaleLowerCase() + "cny/";
    document.getElementById("link_info").href = "/altcoin/" + coinName_cp.toLocaleLowerCase() + "/";
    document.getElementById("link_news").href = "/altcoin/" + coinName_cp.toLocaleLowerCase() + "/?n=1";

    checkIsTrade(coinNameCN);
    function checkIsTrade(cnname)
    {
        if (cnname == "unknown")
        {
            document.getElementById("trade_main").style.textAlign = "center";
            document.getElementById("trade_main").innerHTML = "<div style=\"font-size:22px;line-height:33px\">对不起，我们暂时没有开启" + coinName + "/CNY的交易</div><div style=\"font-size:16px;line-height:24px\">如果您希望我们开通这个交易，<a href=\"http://www.coin38.org\" target=\"_blank\" style=\"#3377AA\">请您到论坛反馈您的意见</a>，我们会综合考虑的，非常感谢！";
            document.title = coinName + "/CNY交易尚未开通";
            return;
        }
    }


    var ajaxObj = null;
    var ajaxObj2 = null;
    var ajaxObj3 = null;
    var ajaxObj4 = null;
    var ajaxObj5 = null;

    function showOrder()
    {
        var myOrderTable = document.getElementById("myOrderTable");
        myOrderTable.rows[1].cells[0].innerHTML = "正在加载我的委单信息";

        if (window.XMLHttpRequest)
        {
            ajaxObj4 = new XMLHttpRequest();
        }
        else if (window.ActiveXObject)
        {
            ajaxObj4 = new ActiveXObject("Microsoft.XMLHTTP");
        }
        if (ajaxObj4 != null)
        {
            var url = "/trade/getUserOrder.php?coinname=" + coinName + "&n=" + Math.random();
            ajaxObj4.onreadystatechange = updateUserOrderInfo;
            ajaxObj4.open("GET", url, true);
            ajaxObj4.send(null);
        }
    }

    function getTradeInfo()
    {
        if (window.XMLHttpRequest)
        {
            ajaxObj2 = new XMLHttpRequest();
        }
        else if (window.ActiveXObject)
        {
            ajaxObj2 = new ActiveXObject("Microsoft.XMLHTTP");
        }

        if (ajaxObj2 != null)
        {
            var url = "/trade/getTradeList30.php?coinname=" + coinName + "&n=" + Math.random();
            ajaxObj2.onreadystatechange = updateTradeInfo;
            ajaxObj2.open("GET", url, true);
            ajaxObj2.send(null);
        }

        if (isLogin)
        {
            document.getElementById("myOrderDiv").style.display = "block";
            showOrder();
        }
    }

    function updateUserOrderInfo()
    {
        if (ajaxObj4.readyState == 4)
        {
            if (ajaxObj4.status == 200)
            {
                var result = ajaxObj4.responseText;

                var myOrderTable = document.getElementById("myOrderTable");
                if (result == "no_order")
                {
                    myOrderTable.rows[1].cells[0].innerHTML = "您目前没有" + coinName + "挂单记录";
                    return;
                }

                var tableRows = myOrderTable.rows.length;
                for (var i = 1; i < tableRows; i++)
                {
                    myOrderTable.deleteRow(1);
                }

                var jsonObj = eval("(" + result + ")");
                for (var i = 0; i < jsonObj.length; i++)
                {
                    var newTr = myOrderTable.insertRow(myOrderTable.rows.length);
                    newTr.style.height = "35px";

                    var newTd_1 = newTr.insertCell(0);
                    newTd_1.innerHTML = jsonObj[i].time.substring(5);

                    var newTd_2 = newTr.insertCell(1);
                    if (jsonObj[i].type == "1")
                        newTd_2.innerHTML = "<font color=\"#0AB92B\">买入</font>";
                    else
                        newTd_2.innerHTML = "<font color=\"#F01717\">卖出</font>";

                    var newTd_3 = newTr.insertCell(2);
                    if (coinName == "DOG" || coinName == "BIL")
                        newTd_3.innerHTML = parseFloat(jsonObj[i].price).toFixed(5).toString();
                    else
                        newTd_3.innerHTML = parseFloat(jsonObj[i].price).toFixed(3).toString();

                    var newTd_4 = newTr.insertCell(3);
                    newTd_4.innerHTML = jsonObj[i].amount;

                    var newTd_5 = newTr.insertCell(4);
                    newTd_5.innerHTML = (parseFloat(jsonObj[i].amount) * parseFloat(jsonObj[i].price)).toFixed(2).toString();

                    var newTd_6 = newTr.insertCell(5);
                    newTd_6.id = "delOrder_" + jsonObj[i].id.toString();
                    newTd_6.innerHTML = "<a href=\"JavaScript:delOrder('" + jsonObj[i].id + "')\"><font color=\"#3377AA\">撤单</font></a>";
                }
            }
        }
    }

    function updateTradeInfo()
    {
        if (ajaxObj2.readyState == 4)
        {
            if (ajaxObj2.status == 200)
            {
                var result = ajaxObj2.responseText;

                //更新成交记录
                var tradeTable = document.getElementById("tradeTable");
                var jsonObj = eval("(" + result + ")");

                if (jsonObj.trade.length == 0)
                {
                    tradeTable.rows[1].cells[0].innerHTML = "当前还没有成交记录";
                }
                else
                {
                    var tableRows = tradeTable.rows.length;
                    for (var i = 1; i < tableRows; i++)
                    {
                        tradeTable.deleteRow(1);
                    }

                    for (var i = 0; i < jsonObj.trade.length; i++)
                    {
                        if (i == 0)
                            document.getElementById("newestPrice").innerHTML = parseFloat(jsonObj.trade[i].price).toString();

                        var newTr = tradeTable.insertRow(tradeTable.rows.length);
                        newTr.style.height = "35px";

                        var newTd_1 = newTr.insertCell(0);
                        newTd_1.innerHTML = jsonObj.trade[i].time.substring(5);

                        var newTd_2 = newTr.insertCell(1);
                        if (jsonObj.trade[i].type == "1")
                            newTd_2.innerHTML = "<font color=\"#0AB92B\">买入</font>";
                        else
                            newTd_2.innerHTML = "<font color=\"#F01717\">卖出</font>";

                        var newTd_3 = newTr.insertCell(2);
                        newTd_3.innerHTML = parseFloat(jsonObj.trade[i].price).toString();

                        var newTd_4 = newTr.insertCell(3);
                        newTd_4.innerHTML = parseFloat(jsonObj.trade[i].volume).toString();

                        var newTd_5 = newTr.insertCell(4);
                        newTd_5.innerHTML = (parseFloat(jsonObj.trade[i].price) * parseFloat(jsonObj.trade[i].volume)).toFixed(2).toString();
                    }
                }

                //更新买单
                var buyOrderTable = document.getElementById("buyOrderTable");

                if (jsonObj.buyOrder.length == 0)
                {
                    buyOrderTable.rows[1].cells[0].innerHTML = "当前还没有用户挂买单";
                }
                else
                {
                    var tableRows = buyOrderTable.rows.length;
                    for (var i = 1; i < tableRows; i++)
                    {
                        buyOrderTable.deleteRow(1);
                    }

                    var orderNum = $("#buyOrderNum").val();
                    if (jsonObj.buyOrder.length < orderNum)
                    {
                        orderNum = jsonObj.buyOrder.length;
                    }
                    for (var i = 0; i < orderNum; i++)
                    {
                        if (i == 0)
                            document.getElementById("buy1Price").innerHTML = parseFloat(jsonObj.buyOrder[i].price).toString();

                        var newTr = buyOrderTable.insertRow(buyOrderTable.rows.length);
                        newTr.onmouseover = function() {
                            this.style.background = '#CCFFCC';
                        }
                        newTr.onmouseout = function() {
                            this.style.background = '#F9F9F9';
                        }
                        newTr.style.height = "35px";

                        var newTd_1 = newTr.insertCell(0);
                        newTd_1.innerHTML = "<font color=\"#0AB92B\">买" + (i + 1).toString() + "</font>";

                        var newTd_2 = newTr.insertCell(1);
                        newTd_2.innerHTML = parseFloat(jsonObj.buyOrder[i].price).toString();

                        var newTd_3 = newTr.insertCell(2);
                        newTd_3.innerHTML = parseFloat(jsonObj.buyOrder[i].amount).toString();

                        var newTd_4 = newTr.insertCell(3);
                        newTd_4.innerHTML = (parseFloat(jsonObj.buyOrder[i].amount) * parseFloat(jsonObj.buyOrder[i].price)).toFixed(2).toString();
                    }
                }

                //更新卖单
                var sellOrderTable = document.getElementById("sellOrderTable");

                if (jsonObj.sellOrder.length == 0)
                {
                    sellOrderTable.rows[1].cells[0].innerHTML = "当前还没有用户挂卖单";
                }
                else
                {
                    var tableRows = sellOrderTable.rows.length;
                    for (var i = 1; i < tableRows; i++)
                    {
                        sellOrderTable.deleteRow(1);
                    }

                    var orderNum = $("#sellOrderNum").val();
                    if (jsonObj.buyOrder.length < orderNum)
                    {
                        orderNum = jsonObj.buyOrder.length;
                    }
                    for (var i = 0; i < orderNum; i++)
                    {
                        if (i == 0)
                            document.getElementById("sell1Price").innerHTML = parseFloat(jsonObj.sellOrder[i].price).toString();

                        var newTr = sellOrderTable.insertRow(sellOrderTable.rows.length);
                        newTr.onmouseover = function() {
                            this.style.background = '#FEDCDC';
                        }
                        newTr.onmouseout = function() {
                            this.style.background = '#F9F9F9';
                        }
                        newTr.style.height = "35px";

                        var newTd_1 = newTr.insertCell(0);
                        newTd_1.innerHTML = "<font color=\"#F01717\">卖" + (i + 1).toString() + "</font>";

                        var newTd_2 = newTr.insertCell(1);
                        newTd_2.innerHTML = parseFloat(jsonObj.sellOrder[i].price).toString();

                        var newTd_3 = newTr.insertCell(2);
                        newTd_3.innerHTML = parseFloat(jsonObj.sellOrder[i].amount).toString();

                        var newTd_4 = newTr.insertCell(3);
                        newTd_4.innerHTML = (parseFloat(jsonObj.sellOrder[i].amount) * parseFloat(jsonObj.sellOrder[i].price)).toFixed(2).toString();
                    }
                }
            }
        }
    }

    function delOrder(order_id)
    {
        document.getElementById("delOrder_" + order_id).innerHTML = "正在提交...";

        if (window.XMLHttpRequest)
        {
            ajaxObj5 = new XMLHttpRequest();
        }
        else if (window.ActiveXObject)
        {
            ajaxObj5 = new ActiveXObject("Microsoft.XMLHTTP");
        }
        if (ajaxObj5 != null)
        {
            var url = "/trade/delOrder.php?order_id=" + order_id + "&n=" + Math.random();
            ajaxObj5.onreadystatechange = delOrderResponse;
            ajaxObj5.open("GET", url, true);
            ajaxObj5.send(null);
        }
    }

    function delOrderResponse()
    {
        if (ajaxObj5.readyState == 4)
        {
            if (ajaxObj5.status == 200)
            {
                var result = ajaxObj5.responseText;
                if (result == "succ")
                {
                    alert("您已成功撤掉该委单");
                    window.location.reload();
                    return;
                }
                else
                    alert("撤单失败，失败原因" + result);
            }
        }
    }

    var glb_order_type = "0";
    var glb_order_price = "0";
    var glb_order_amount = "0";
    function submitOrder(type)
    {
        var price = document.getElementById("price" + type).value;
        var amount = document.getElementById("amount" + type).value;
        var totalBalance = document.getElementById("totalBalance" + type).value;
        glb_order_type = type;
        glb_order_price = price;
        glb_order_amount = amount;

        if (isNaN(price) || isNaN(amount) || parseFloat(price) <= 0 || parseFloat(amount) <= 0)
        {
            alert("请正确输入挂单价格和数量。");
            return;
        }

        if (parseFloat(totalBalance) < 1)
        {
            alert("对不起，您的挂单金额太小，现在不支持交易额在1元以下的挂单");
            return;
        }

        if (type == "1")
        {
            if (parseFloat(totalBalance) > parseFloat(document.getElementById("cny_balance1").value))
            {
                alert("CNY余额不足，您挂单的成交额已经超出了您的CNY余额。");
                return;
            }
        }
        else if (type == "2")
        {
            if (parseFloat(amount) > parseFloat(document.getElementById("coin_balance2").value))
            {
                alert(coinName + "余额不足，您挂单的" + coinName + "数量已经超出了您的" + coinName + "余额。");
                return;
            }
        }

        if (type == "1")
            document.getElementById("submitOrderBTN" + type).innerHTML = "<img src=\"http://rs.btc38.com/statics/images/v9/m_confirm_buy_gray.png\">";
        else if (type == "2")
            document.getElementById("submitOrderBTN" + type).innerHTML = "<img src=\"http://rs.btc38.com/statics/images/v9/m_confirm_sell_gray.png\">";

        var pwd_need = "0";
        var arr = document.cookie.split("; ");
        for (var i = 0; i < arr.length; i++) {
            if (arr[i].indexOf("=") < 0)
                continue;
            var cookie_arr_item = arr[i].split("=");
            if (cookie_arr_item[0] == "BTC38_trade_pwd_is_need") {
                pwd_need = cookie_arr_item[1];
                break;
            }
        }

        if (pwd_need == "0")
        {
            if (window.XMLHttpRequest)
            {
                ajaxObj = new XMLHttpRequest();
            }
            else if (window.ActiveXObject)
            {
                ajaxObj = new ActiveXObject("Microsoft.XMLHTTP");
            }

            if (ajaxObj != null)
            {
                var url = "/trade/newOrder2.php?n=" + Math.random();
                var check = $.cookie('BTC38_md5');
                var data = "coinname=" + coinName + "&type=" + type + "&price=" + price + "&amount=" + amount + "&check=" + check;
                ajaxObj.onreadystatechange = newOrderResponse;
                ajaxObj.open("POST", url, true);
                ajaxObj.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
                ajaxObj.send(data);
            }
        }
        else
        {
            document.getElementById("pwdDiv").style.display = "block";
            document.getElementById("price" + type).disabled = "disabled";
            document.getElementById("amount" + type).disabled = "disabled";
        }
    }

    function submitOrderAndPWD()
    {
        document.getElementById("pwd_submit_td").innerHTML = "<img src=\"http://rs.btc38.com/statics/images/v9/m_btn_pwdsubmit.png\">";

        if (window.XMLHttpRequest)
        {
            ajaxObj = new XMLHttpRequest();
        }
        else if (window.ActiveXObject)
        {
            ajaxObj = new ActiveXObject("Microsoft.XMLHTTP");
        }

        if (ajaxObj != null)
        {
            var url = "/trade/newOrder2.php?n=" + Math.random();
            var check = $.cookie('BTC38_md5');
            var data = "coinname=" + coinName + "&type=" + glb_order_type + "&price=" + glb_order_price + "&amount=" + glb_order_amount + "&pwd=" + encodeURIComponent(document.getElementById("order_pwd").value) + "&check=" + check;
            ajaxObj.onreadystatechange = newOrderResponse;
            ajaxObj.open("POST", url, true);
            ajaxObj.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
            ajaxObj.send(data);
        }
    }

    function newOrderResponse()
    {
        if (ajaxObj.readyState == 4)
        {
            if (ajaxObj.status == 200)
            {
                if (ajaxObj.responseText == "succ")
                {
                    alert("您已成功挂单");
                    var date = new Date();
                    var expiresDays = 1;
                    date.setTime(date.getTime() + expiresDays * 24 * 3600 * 1000);
                    document.cookie = "BTC38_trade_pwd_is_need=0; path=/; expires=" + date.toGMTString();
                    window.location.reload();
                    return;
                }
                else if (ajaxObj.responseText == "system_busy")
                {
                    alert("系统繁忙，您的挂单可能没有成功，请您核查。");
                    window.location.reload();
                    return;
                }
                else if (ajaxObj.responseText == "zombie")
                {
                    alert("您的帐号太多，本帐号的交易功能已被关闭，若您有交易需求，请使用您的其它帐号，给您带来不便，我们深表歉意。");
                    return;
                }
                else if (ajaxObj.responseText == "wrongmd5")
                {
                    alert("您的登录信息已失效，请点击右上角QQ头像旁边的“退出登录”按钮，重新登录");
                    return;
                }
                else if (ajaxObj.responseText == "wrong_trade_pwd")
                {
                    alert("交易密码不正确，请您重新尝试");
                    document.getElementById("pwd_submit_td").innerHTML = "<a href=\"JavaScript:submitOrderAndPWD();\"><img src=\"http://rs.btc38.com/statics/images/v9/m_btn_pwdsubmit.png\"></a>";
                    return;
                }
                else
                {
                    alert("挂单失败，失败原因：" + ajaxObj.responseText);
                    return;
                }
            }
        }
    }

    function displayBuyBanner()
    {
        if (isLogin)
        {
            document.getElementById("sellBox").style.display = "none";
            document.getElementById("buyBox").style.display = "block";
            document.getElementById("price1").value = document.getElementById("sell1Price").innerHTML;
            getUserBalance();
        }
        else
        {
            alert("对不起，请先登录再操作。");
        }
    }
    function displaySellBanner()
    {
        if (isLogin)
        {
            document.getElementById("buyBox").style.display = "none";
            document.getElementById("sellBox").style.display = "block";
            document.getElementById("price2").value = document.getElementById("buy1Price").innerHTML;
            getUserBalance();
        }
        else
        {
            alert("对不起，请先登录再操作。");
        }
    }

    function getUserBalance(type)
    {
        if (window.XMLHttpRequest)
        {
            ajaxObj3 = new XMLHttpRequest();
        }
        else if (window.ActiveXObject)
        {
            ajaxObj3 = new ActiveXObject("Microsoft.XMLHTTP");
        }

        if (ajaxObj3 != null)
        {
            var url = "/trade/getUserBalance.php?n=" + Math.random();
            var postData = "check=" + $.cookie('BTC38_md5');
            ajaxObj3.onreadystatechange = updateUserBalance;
            ajaxObj3.open("POST", url, true);
            ajaxObj3.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
            ajaxObj3.send(postData);
        }
    }

    function updateUserBalance()
    {
        if (ajaxObj3.readyState == 4)
        {
            if (ajaxObj3.status == 200)
            {
                var result = ajaxObj3.responseText;
                if (result.length > 32)
                {
                    var jsonObj = eval("(" + result + ")");

                    var coin_balance = "0.000000";
                    if (coinName == "BTC")
                        coin_balance = jsonObj.btc_balance;
                    else if (coinName == "LTC")
                        coin_balance = jsonObj.ltc_balance;
                    else if (coinName == "XPM")
                        coin_balance = jsonObj.xpm_balance;
                    else if (coinName == "XRP")
                        coin_balance = jsonObj.xrp_balance;
                    else if (coinName == "ZCC")
                        coin_balance = jsonObj.zcc_balance;
                    else if (coinName == "MEC")
                        coin_balance = jsonObj.mec_balance;
                    else if (coinName == "ANC")
                        coin_balance = jsonObj.anc_balance;
                    else if (coinName == "BEC")
                        coin_balance = jsonObj.bec_balance;
                    else if (coinName == "PPC")
                        coin_balance = jsonObj.ppc_balance;
                    else if (coinName == "SRC")
                        coin_balance = jsonObj.src_balance;
                    else if (coinName == "TAG")
                        coin_balance = jsonObj.tag_balance;
                    else if (coinName == "PTS")
                        coin_balance = jsonObj.pts_balance;
                    else if (coinName == "WDC")
                        coin_balance = jsonObj.wdc_balance;
                    else if (coinName == "APC")
                        coin_balance = jsonObj.apc_balance;
                    else if (coinName == "DGC")
                        coin_balance = jsonObj.dgc_balance;
                    else if (coinName == "UNC")
                        coin_balance = jsonObj.unc_balance;
                    else if (coinName == "QRK")
                        coin_balance = jsonObj.qrk_balance;
                    else if (coinName == "DOG")
                        coin_balance = jsonObj.dog_balance;
                    else if (coinName == "YBC")
                        coin_balance = jsonObj.ybc_balance;
                    else if (coinName == "RIC")
                        coin_balance = jsonObj.ric_balance;
                    else if (coinName == "BIL")
                        coin_balance = jsonObj.bil_balance;
                    else if (coinName == "TMC")
                        coin_balance = jsonObj.tmc_balance;
                    document.getElementById("cny_balance1").value = jsonObj.cny_balance;
                    document.getElementById("cny_balance2").value = jsonObj.cny_balance;
                    document.getElementById("coin_balance1").value = coin_balance;
                    document.getElementById("coin_balance2").value = coin_balance;
                    initInputsNum();
                }
            }
        }
    }

    function initInputsNum()
    {
        if (parseFloat(document.getElementById("price1").value) > 0)
            document.getElementById("maxNum1").value = (parseFloat(document.getElementById("cny_balance1").value) / parseFloat(document.getElementById("price1").value) - 0.0000005).toFixed(6).toString();
        else
            document.getElementById("maxNum1").value = "0.000000";

        document.getElementById("amount1").value = document.getElementById("maxNum1").value;
        document.getElementById("actuallyGet1").value = (parseFloat(document.getElementById("amount1").value) * t_fee).toFixed(6).toString();
        document.getElementById("totalBalance1").value = (parseFloat(document.getElementById("price1").value) * parseFloat(document.getElementById("amount1").value)).toFixed(6).toString();

        document.getElementById("maxNum2").value = (parseFloat(document.getElementById("coin_balance2").value) * parseFloat(document.getElementById("price2").value)).toFixed(6).toString();
        document.getElementById("amount2").value = document.getElementById("coin_balance2").value;
        document.getElementById("totalBalance2").value = (parseFloat(document.getElementById("price2").value) * parseFloat(document.getElementById("amount2").value)).toFixed(6).toString();
        document.getElementById("actuallyGet2").value = (parseFloat(document.getElementById("totalBalance2").value) * t_fee).toFixed(6).toString();
    }

    function resetInputsNumByPrice1()
    {
        var point_pos = document.getElementById("price1").value.indexOf(".");

        if (coinName == "DOG" || coinName == "BIL")
        {
            if (point_pos >= 0 && point_pos + 6 < document.getElementById("price1").value.length)
                document.getElementById("price1").value = document.getElementById("price1").value.substring(0, point_pos + 6);
        }
        else
        {
            if (point_pos >= 0 && point_pos + 4 < document.getElementById("price1").value.length)
                document.getElementById("price1").value = document.getElementById("price1").value.substring(0, point_pos + 4);
        }

        if (parseFloat(document.getElementById("price1").value) > 0)
            document.getElementById("maxNum1").value = (parseFloat(document.getElementById("cny_balance1").value) / parseFloat(document.getElementById("price1").value) - 0.0000005).toFixed(6).toString();
        else
            document.getElementById("maxNum1").value = "0.000000";

        document.getElementById("totalBalance1").value = (parseFloat(document.getElementById("price1").value) * parseFloat(document.getElementById("amount1").value)).toFixed(6).toString();
    }

    function resetInputsNumByPrice2()
    {
        var point_pos = document.getElementById("price2").value.indexOf(".");
        if (coinName == "DOG" || coinName == "BIL")
        {
            if (point_pos >= 0 && point_pos + 6 < document.getElementById("price2").value.length)
                document.getElementById("price2").value = document.getElementById("price2").value.substring(0, point_pos + 6);
        }
        else
        {
            if (point_pos >= 0 && point_pos + 4 < document.getElementById("price2").value.length)
                document.getElementById("price2").value = document.getElementById("price2").value.substring(0, point_pos + 4);
        }

        document.getElementById("maxNum2").value = (parseFloat(document.getElementById("coin_balance2").value) * parseFloat(document.getElementById("price2").value)).toFixed(6).toString();
        document.getElementById("totalBalance2").value = (parseFloat(document.getElementById("price2").value) * parseFloat(document.getElementById("amount2").value)).toFixed(6).toString();
        document.getElementById("actuallyGet2").value = (parseFloat(document.getElementById("totalBalance2").value) * t_fee).toFixed(6).toString();
    }

    function resetInputsNumByAmount1()
    {
        var point_pos = document.getElementById("amount1").value.indexOf(".");

        if (point_pos >= 0 && point_pos + 7 < document.getElementById("amount1").value.length)
            document.getElementById("amount1").value = document.getElementById("amount1").value.substring(0, point_pos + 7);

        document.getElementById("actuallyGet1").value = (parseFloat(document.getElementById("amount1").value) * t_fee).toFixed(6).toString();
        document.getElementById("totalBalance1").value = (parseFloat(document.getElementById("price1").value) * parseFloat(document.getElementById("amount1").value)).toFixed(6).toString();
    }

    function resetInputsNumByAmount2()
    {
        var point_pos = document.getElementById("amount2").value.indexOf(".");

        if (point_pos >= 0 && point_pos + 7 < document.getElementById("amount2").value.length)
            document.getElementById("amount2").value = document.getElementById("amount2").value.substring(0, point_pos + 7);

        document.getElementById("totalBalance2").value = (parseFloat(document.getElementById("price2").value) * parseFloat(document.getElementById("amount2").value)).toFixed(6).toString();
        document.getElementById("actuallyGet2").value = (parseFloat(document.getElementById("totalBalance2").value) * t_fee).toFixed(6).toString();
    }

    getTradeInfo();
    window.setInterval(getTradeInfo, 30000);
    $("#buyOrderNum").change(function() {
        var orderNum = $("#buyOrderNum").val();
        $("#sellOrderNum").find("option[value='" + orderNum + "']").attr("selected", true);
        getTradeInfo();
    })
    $("#sellOrderNum").change(function() {
        var orderNum = $("#sellOrderNum").val();
        $("#buyOrderNum").find("option[value='" + orderNum + "']").attr("selected", true);
        getTradeInfo();
    })

    var ajaxObj6 = null;
    var ajaxObj7 = null;
    var ajaxObj8 = null;
    $(document).ready(function() {
        getTimeLine();
    });

    function getDayLine()
    {
        if (window.XMLHttpRequest)
        {
            ajaxObj7 = new XMLHttpRequest();
        }
        else if (window.ActiveXObject)
        {
            ajaxObj7 = new ActiveXObject("Microsoft.XMLHTTP");
        }

        if (ajaxObj7 != null)
        {
            var url = "/trade/getTradeDayLine.php?coinname=" + coinName + "&n=" + Math.random();
            ajaxObj7.onreadystatechange = displayDayLine;
            ajaxObj7.open("GET", url, true);
            ajaxObj7.send(null);
        }
    }

    function displayDayLine()
    {
        if (ajaxObj7.readyState == 4)
        {
            if (ajaxObj7.status == 200)
            {
                var trade_day_line = eval(ajaxObj7.responseText);

                var datas = trade_day_line;
                var rates = [];
                var vols = [];
                for (i = 0; i < datas.length; i++) {
                    rates.push([
                        datas[i][0],
                        datas[i][2],
                        datas[i][3],
                        datas[i][4],
                        datas[i][5]
                    ]);

                    vols.push([
                        datas[i][0],
                        datas[i][1]
                    ])
                }

                Highcharts.setOptions({
                    colors: ['#DD1111', '#FF0000', '#DDDF0D', '#7798BF', '#55BF3B', '#DF5353', '#aaeeee', '#ff0066', '#eeaaee', '#55BF3B', '#DF5353', '#7798BF', '#aaeeee'],
                    lang: {
                        loading: 'Loading...',
                        months: ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'],
                        shortMonths: ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'],
                        weekdays: ['周日', '周一', '周二', '周三', '周四', '周五', '周六'],
                        decimalPoint: '.',
                        numericSymbols: ['k', 'M', 'G', 'T', 'P', 'E'],
                        resetZoom: 'Reset zoom',
                        resetZoomTitle: 'Reset zoom level 1:1',
                        thousandsSep: ','
                    },
                    credits: {enabled: false},
                    global: {useUTC: false}
                });

                trade_day_line.main_chart = new Highcharts.StockChart({
                    chart: {renderTo: 'graphbox', width: 658},
                    xAxis: {type: 'datetime'},
                    legend: {enabled: false},
                    plotOptions: {candlestick: {color: '#f01717', upColor: '#0ab92b'}},
                    tooltip: {xDateFormat: '%Y-%m-%d %H:%M %A', color: '#f0f', changeDecimals: 4, borderColor: '#058dc7'},
                    scrollbar: {enabled: false},
                    navigator: {enabled: false},
                    rangeSelector: {enabled: false},
                    yAxis: [
                        {top: 35, height: 193, labels: {style: {color: '#CC3300'}}, title: {text: '价格', style: {color: '#CC3300'}}, gridLineDashStyle: 'Dash'},
                        {top: 228, height: 70, labels: {style: {color: '#4572A7'}}, title: {text: '成交量', style: {color: '#4572A7'}}, gridLineDashStyle: 'Dash', offset: 0}
                    ],
                    series: [
                        {animation: false, name: '成交量', type: 'column', color: '#4572A7', marker: {enabled: false}, yAxis: 1, data: vols},
                        {animation: false, name: '价格', type: 'candlestick', marker: {enabled: false}, data: rates}
                    ]
                });
            }

        }
    }

    function getTimeLine()
    {
        if (window.XMLHttpRequest)
        {
            ajaxObj6 = new XMLHttpRequest();
        }
        else if (window.ActiveXObject)
        {
            ajaxObj6 = new ActiveXObject("Microsoft.XMLHTTP");
        }

        if (ajaxObj6 != null)
        {
            var url = "/trade/getTradeTimeLine.php?coinname=" + coinName + "&n=" + Math.random();
            ajaxObj6.onreadystatechange = displayTimeLine;
            ajaxObj6.open("GET", url, true);
            ajaxObj6.send(null);
        }
    }

    function displayTimeLine()
    {
        if (ajaxObj6.readyState == 4)
        {
            if (ajaxObj6.status == 200)
            {
                var trade_time_line = eval(ajaxObj6.responseText);
                var volumeOf24Hours = 0;
                var balanceOf24Hours = 0;
                var time_line_length = trade_time_line.length;
                for (var i = 0; i < time_line_length && i < 24; i++)
                {
                    volumeOf24Hours += trade_time_line[time_line_length - i - 1][1];
                    balanceOf24Hours += trade_time_line[time_line_length - i - 1][1] * trade_time_line[time_line_length - i - 1][2];
                }
                document.getElementById("volumeOf24Hours").innerHTML = volumeOf24Hours.toFixed(0).toString();
                document.getElementById("balanceOf24Hours").innerHTML = balanceOf24Hours.toFixed(0).toString();

                var datas = trade_time_line;
                var rates = [];
                var vols = [];
                for (i = 0; i < datas.length; i++) {
                    rates.push([
                        datas[i][0],
                        datas[i][2],
                        datas[i][3],
                        datas[i][4],
                        datas[i][5]
                    ]);

                    vols.push([
                        datas[i][0],
                        datas[i][1]
                    ])
                }

                Highcharts.setOptions({
                    colors: ['#DD1111', '#FF0000', '#DDDF0D', '#7798BF', '#55BF3B', '#DF5353', '#aaeeee', '#ff0066', '#eeaaee', '#55BF3B', '#DF5353', '#7798BF', '#aaeeee'],
                    lang: {
                        loading: 'Loading...',
                        months: ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'],
                        shortMonths: ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'],
                        weekdays: ['周日', '周一', '周二', '周三', '周四', '周五', '周六'],
                        decimalPoint: '.',
                        numericSymbols: ['k', 'M', 'G', 'T', 'P', 'E'],
                        resetZoom: 'Reset zoom',
                        resetZoomTitle: 'Reset zoom level 1:1',
                        thousandsSep: ','
                    },
                    credits: {enabled: false},
                    global: {useUTC: false}
                });

                trade_time_line.main_chart = new Highcharts.StockChart({
                    chart: {renderTo: 'graphbox', width: 658},
                    xAxis: {type: 'datetime'},
                    legend: {enabled: false},
                    plotOptions: {candlestick: {color: '#f01717', upColor: '#0ab92b'}},
                    tooltip: {xDateFormat: '%Y-%m-%d %H:%M %A', color: '#f0f', changeDecimals: 4, borderColor: '#058dc7'},
                    scrollbar: {enabled: false},
                    navigator: {enabled: false},
                    rangeSelector: {enabled: false},
                    yAxis: [
                        {top: 35, height: 193, labels: {style: {color: '#CC3300'}}, title: {text: '价格', style: {color: '#CC3300'}}, gridLineDashStyle: 'Dash'},
                        {top: 228, height: 70, labels: {style: {color: '#4572A7'}}, title: {text: '成交量', style: {color: '#4572A7'}}, gridLineDashStyle: 'Dash', offset: 0}
                    ],
                    series: [
                        {animation: false, name: '成交量', type: 'column', color: '#4572A7', marker: {enabled: false}, yAxis: 1, data: vols},
                        {animation: false, name: '价格', type: 'candlestick', marker: {enabled: false}, data: rates}
                    ]
                });
            }
        }
    }

    function get5minLine()
    {
        if (window.XMLHttpRequest)
        {
            ajaxObj8 = new XMLHttpRequest();
        }
        else if (window.ActiveXObject)
        {
            ajaxObj8 = new ActiveXObject("Microsoft.XMLHTTP");
        }

        if (ajaxObj8 != null)
        {
            var url = "/trade/getTrade5minLine.php?coinname=" + coinName + "&n=" + Math.random();
            ajaxObj8.onreadystatechange = display5minLine;
            ajaxObj8.open("GET", url, true);
            ajaxObj8.send(null);
        }
    }

    function display5minLine()
    {
        if (ajaxObj8.readyState == 4)
        {
            if (ajaxObj8.status == 200)
            {
                var trade_5min_line = eval(ajaxObj8.responseText);

                var datas = trade_5min_line;
                var rates = [];
                var vols = [];
                for (i = 0; i < datas.length; i++) {
                    rates.push([
                        datas[i][0],
                        datas[i][2],
                        datas[i][3],
                        datas[i][4],
                        datas[i][5]
                    ]);

                    vols.push([
                        datas[i][0],
                        datas[i][1]
                    ])
                }

                Highcharts.setOptions({
                    colors: ['#DD1111', '#FF0000', '#DDDF0D', '#7798BF', '#55BF3B', '#DF5353', '#aaeeee', '#ff0066', '#eeaaee', '#55BF3B', '#DF5353', '#7798BF', '#aaeeee'],
                    lang: {
                        loading: 'Loading...',
                        months: ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'],
                        shortMonths: ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'],
                        weekdays: ['周日', '周一', '周二', '周三', '周四', '周五', '周六'],
                        decimalPoint: '.',
                        numericSymbols: ['k', 'M', 'G', 'T', 'P', 'E'],
                        resetZoom: 'Reset zoom',
                        resetZoomTitle: 'Reset zoom level 1:1',
                        thousandsSep: ','
                    },
                    credits: {enabled: false},
                    global: {useUTC: false}
                });

                trade_5min_line.main_chart = new Highcharts.StockChart({
                    chart: {renderTo: 'graphbox', width: 658},
                    xAxis: {type: 'datetime'},
                    legend: {enabled: false},
                    plotOptions: {candlestick: {color: '#f01717', upColor: '#0ab92b'}},
                    tooltip: {xDateFormat: '%Y-%m-%d %H:%M %A', color: '#f0f', changeDecimals: 4, borderColor: '#058dc7'},
                    scrollbar: {enabled: false},
                    navigator: {enabled: false},
                    rangeSelector: {enabled: false},
                    yAxis: [
                        {top: 35, height: 193, labels: {style: {color: '#CC3300'}}, title: {text: '价格', style: {color: '#CC3300'}}, gridLineDashStyle: 'Dash'},
                        {top: 228, height: 70, labels: {style: {color: '#4572A7'}}, title: {text: '成交量', style: {color: '#4572A7'}}, gridLineDashStyle: 'Dash', offset: 0}
                    ],
                    series: [
                        {animation: false, name: '成交量', type: 'column', color: '#4572A7', marker: {enabled: false}, yAxis: 1, data: vols},
                        {animation: false, name: '价格', type: 'candlestick', marker: {enabled: false}, data: rates}
                    ]
                });
            }
        }
    }


</script>